<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>RepresentedBy README</title>
<style type="text/css">
<!--
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
}
body {
	background-color: #FFFFFF;
	margin-left: 10px;
	margin-top: 10px;
	margin-right: 10px;
	margin-bottom: 10px;
}
-->
</style></head>

<body>
<h1>RepresentedBy README</h1>
<h2>Preface</h2>
<p>The idea for RepresentedBy came about shortly after the inauguration in January 2009. I was interested in creating some software to promote transparency in government and was intrigued by the idea of building something for Facebook using Google App Engine as it seemed like a great way to potentially reach a huge audience without killing my web server. Plus, it would be a good excuse to get my hands dirty with Python and the Facebook API -- two things which I had practically no experience with.</p>
<p>The next two months involved a lot of nights and weekends coding, researching, and re-writing and the result is this initial version of RepresentedBy. I'm still a novice at Python and while I think I've got the syntax down, I still have quite a bit to learn about proper Python architecture, so while there are a lot of concepts demonstrated in this app, please don't use it as an example of overall application architecture in Python. Fixing that will be one of the first priorities once the source code has been posted to Google Code. In the meantime, enjoy the code, I hope you find it useful.</p>
<h2>Getting the app to run</h2>
<p>This code will not run immediately out of the box. You will need to do a few things first.</p>
<ul>
  <li>Set up your app on Facebook</li>
  <li>Set up an app on Google AppEngine</li>
  <li>Get your own API keys for Sunlight Labs, Open Secret, NYTimes, and Facebook and them add them to the const.py file</li>
  <li>Download and install the <a href="http://code.google.com/p/gdata-python-client/">Google YouTube libraries for Python</a>. I did not include them in my package.</li>
</ul>
<h2>End User Goals</h2>
<p>RepresentedBy was created initially to serve several purposes:</p>
<ul>
  <li>To increase civic engagement.</li>
  <li>To increase personal awareness of the legislators representing you in Congress and how they are voting on important issues.</li>
  <li>To share information about your representatives with your friends, and to encourage civic engagement among your peers.</li>
  <li>To provide an open source learning template for Facebook applications developed with Google App Engine.</li>
</ul>
<h2>Technical Concepts</h2>
<p>One of the goals of RepresentedBy is to provide some simple, real world examples of a Facebook application built with Google App Engine. The following is a list of technical concepts which are covered in RepresentedBy. So if you're trying to learn about Facebook apps or building Facebook apps on Python with Google App Engine, this is a quick guide to help you drill down into the source code.</p>
<ul>
  <li>Demonstration of the PyFacebook python library (utils.py line XXXX, main.py, line XXXX)</li>
  <li>Demonstration of the Python YouTube library (youtube.py)</li>
  <li>Demonstration of implementing a Google Map as an iframe in a Facebook app (location.py, gmap.fbml, includes/gmap.html)</li>
  <li>Demonstration of using Python to create a page that makes AJAX calls using FBJS (templates/column_left.fbml in conjunction with votes.py, news.py, tweets.py, youtube.py)</li>
  <li>Simple Python code to convert datetime objects to Facebook time (e.g. &quot;4 hours ago&quot;, &quot;3 days ago&quot;) (utils.py line XXX)</li>
  <li>Using Django templates to generate Facebook pages and custom boxes on Facebook profiles (main.py line XXX)</li>
  <li>Using custom CSS to override default Facebook attributes (e.g. setting a custom width for &lt;fb:feed&gt;) (includes/styles.css)</li>
  <li>Establishing a basic framework for caching third party API responses as native Python objects (utils.py line XXX)</li>
</ul>
<h2>Source Code</h2>
<p>The source code for RepresentedBy is open source (GPLv3) and available from Google Code.</p>
<h2>Credits</h2>

<p>The application itself could not have been made possible without the data and services listed below.</p>
<div class="fbgreybox" style="width:700px;margin:20px">
<div>
<table cellpadding="2" cellspacing="2">
  <tr><td align="right"><a href="http://www.sunlightlabs.com/"><img src="http://representedby.appspot.com/includes/sunlightlogo.jpg" width="150" height="41" border=0></a></td>
<td><a href="http://www.sunlightlabs.com/">Sunlight Labs API</a> _ Provides detailed information about each legislator as well as providing a lookup mechanism to determine what congressional districts you and your friends are part of.</td>
  </tr>
<tr><td align="right"><a href="http://www.opensecrets.org/"><img src="http://representedby.appspot.com/includes/os_logo.jpg" width="130" height="49" border=0></a></td>
<td><a href="http://www.opensecrets.org/">Open Secrets API</a> _ Provides detailed information about which industries contributed money to legislators.</td>
</tr>
<tr><td align="right"><a href="http://developer.nytimes.com/"><img src="http://developer.nytimes.com/public/Mashery/images/clients/nyt/nyt.gif" width="153" height="23" border=0></a></td>
<td><a href="http://developer.nytimes.com/">NYTimes Congress API</a> _ Provides detailed information about congressional voting information, as well as information about each bill in Congress.</td>
</tr>
<tr><td align="right"><a href="http://www.govtrack.us/"><img src="http://www.govtrack.us/media/linklogo.png" width="186" height="36" border=0></a></td>
<td><a href="http://www.govtrack.us/">Govtrack Google Maps overlay</a> _ Provides the congressional overlay on the Google Map used when <a href="http://apps.facebook.com/representedby/location">selecting your district</a>.</td>
</tr>
<tr><td align="right"><a href="http://code.google.com/appengine/"><img src="http://code.google.com/appengine/images/appengine_noborder_120x30.gif" 
alt="Powered by Google App Engine" width="120" height="30" border="0" /></a></td>
<td><a href="http://code.google.com/appengine/">Google App Engine</a> _ Free, Python powered scalable hosting infrastructure.</td>
</tr>
<tr><td align="right"><a href="http://www.rga.com/"><img src="http://rga.com/img/feedlogo.jpg" width="119" height="36" border=0></a></td>
<td>While this is definitely a personal, side project of mine and is not associated in any way with my full time employer, I have to give a shout out to them because it's a really great place to work. <a href="http://www.rga.com/">Check it out.</a></td>
</tr>
<tr><td align="right"><a href="http://wubbahed.com/"><img src="http://qrcode.kaywa.com/img.php?s=3&amp;d=http%3A//wubbahed.com" alt="qrcode" border="0"  /></a></td>
<td><a href="http://wubbahed.com/">wubbahed.com</a> _ this is my personal site where I blog every now and then about random things I'm working on. About 70% is tech heavy stuff with an emphasis on mobile, and the other 30% cover the really fun things like <a href="http://wubbahed.com/category/food/">sausage making</a> and <a href="http://wubbahed.com/category/knitting/">knitting</a>.</td>
</tr></table>
</div>
</div>

</body>
</html>
